import time

from Page.Page import Page
from selenium import webdriver
import unittest
class Case(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Edge()
        self.driver.maximize_window()
        self.driver.implicitly_wait(5)
    def tearDown(self):
        time.sleep(5)
        self.driver.quit()

    def test_01(self):
        po = Page(self.driver)
        po.luoji_login()
    def test_02(self):
        po = Page(self.driver)
        po.luoji_login()
        # 断言2 账号 jxw267546976
        print(po.dy2())
        po.search()
        po.sou()
        po.Enter()
        # 断言3 全部商品分类
        print(po.dy3())
        self.driver.execute_script("window.scrollTo(0,300)")
        po.addcar()
        time.sleep(1)
        # 断言4 该商品已成功放入购物车
        print(po.dy4())
        po.look_car()
        time.sleep(2)
        # 断言5 我的购物车+数量
        print(po.dy5())
        po.jiesuan()
        # 断言6 确认订单信息
        print(po.dy6())
        po.tijiao()
        # 断言7 请你在约定时间内完成支付，逾期订单将被取消！
        print(po.dy7)



if __name__ == '__main__':
    unittest.main()